# coding=utf-8
__author__ = 'Administrator'

from django.test import TestCase
from ..base_monitor import CPU

class CPUTest(TestCase):

    def to_json(self):
        c = CPU()
        c.info = "inter I5"
        c.tg = 45
        c.ip = "10.10.9.123"

        print("===test to_json start====")
        json = CPU.to_json(c)
        print("===to_json== %s" % json)

        c.json = json
        cc = CPU.dict2object(json)

        print("===to_object===%s" % cc.__class__)
